<template>
  <div class="hospitalNoticeDetail_box">
    <el-page-header
      class="hospitalNoticeDetail_goBack"
      @back="$router.go(-1)"
    />
    <div class="hospitalNoticeDetail_title">{{ currentNotice.title }}</div>
    <el-divider />
    <div class="hospitalNoticeDetail_info">发布时间：{{ currentNotice.time }}</div>
    <div class="hospitalNoticeDetail_content">{{ currentNotice.content }}</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      currentNotice: {}
    }
  },
  created() {
    this.initNotice();
  },
  methods: {
    initNotice() {
      this.currentNotice = this.$store.getters['hospital/getCurrentNotice'];
      if (!this.currentNotice.title) {
        this.$router.go(-1);
      }
    }
  }
}
</script>

<style lang="scss">
.hospitalNoticeDetail_box {
  background: #FFFFFF;
  margin: 10px 30px 0px 30px;
  width: calc(100% - 60px);
  min-height: 700px;

  .hospitalNoticeDetail_goBack {
    padding-top: 10px;
  }

  .hospitalNoticeDetail_title {
    width: 90%;
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    margin: 20px auto 0px auto;
  }

  .hospitalNoticeDetail_info {
    height: 50px;
    line-height: 50px;
    text-align: center;
    font-size: 14px;
    color: #8C8C8C;
  }

  .hospitalNoticeDetail_content {
    width: 70%;
    margin: 50px auto 0px auto;
  }
}

.el-divider--horizontal {
  width: 85%;
  margin: 24px auto;
}

</style>
